/*  1:   */ package org.intellij.html;
/*  2:   */ 
/*  3:   */

import com.intellij.html.RelaxedHtmlNSDescriptor;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.psi.xml.XmlDocument;
import com.intellij.psi.xml.XmlTag;
import com.intellij.util.ArrayUtil;
import com.intellij.xml.XmlElementDescriptor;
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
import com.intellij.xml.util.HtmlUtil;
import org.intellij.plugins.relaxNG.model.descriptors.RngNsDescriptor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */ 
/* 15:   */ public class RelaxedHtmlFromRngNSDescriptor
/* 16:   */   extends RngNsDescriptor
/* 17:   */   implements RelaxedHtmlNSDescriptor
/* 18:   */ {
/* 19:35 */   private static final Logger h = Logger.getInstance("#org.intellij.html.RelaxedHtmlFromRngNSDescriptor");
/* 20:   */   
/* 21:   */   public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag paramXmlTag)
/* 22:   */   {
/* 23:38 */     if (paramXmlTag == null) {
/* 24:38 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/html/RelaxedHtmlFromRngNSDescriptor", "getElementDescriptor" }));
/* 25:   */     }
/* 26:38 */     XmlElementDescriptor localXmlElementDescriptor = super.getElementDescriptor(paramXmlTag);
/* 27:40 */     if (h.isDebugEnabled()) {
/* 28:41 */       h.debug("Descriptor from rng for tag " + paramXmlTag.getName() + " is " + (localXmlElementDescriptor != null ? localXmlElementDescriptor.getClass().getCanonicalName() : "NULL"));
/* 29:   */     }
/* 30:   */     String str;
/* 31:48 */     if ((localXmlElementDescriptor == null) && (!(str = paramXmlTag.getNamespace()).equals("http://www.w3.org/1999/xhtml"))) {
/* 32:50 */       return new AnyXmlElementDescriptor(null, "http://www.w3.org/1999/html".equals(str) ? this : paramXmlTag.getNSDescriptor(paramXmlTag.getNamespace(), true));
/* 33:   */     }
/* 34:56 */     return localXmlElementDescriptor;
/* 35:   */   }
/* 36:   */   
/* 37:   */   protected XmlElementDescriptor initDescriptor(@NotNull XmlElementDescriptor paramXmlElementDescriptor)
/* 38:   */   {
/* 39:61 */     if (paramXmlElementDescriptor == null) {
/* 40:61 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/html/RelaxedHtmlFromRngNSDescriptor", "initDescriptor" }));
/* 41:   */     }
/* 42:61 */     return new RelaxedHtmlFromRngElementDescriptor(paramXmlElementDescriptor);
/* 43:   */   }
/* 44:   */   
/* 45:   */   @NotNull
/* 46:   */   public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable XmlDocument paramXmlDocument)
/* 47:   */   {
/* 48:66 */     XmlElementDescriptor[] tmp15_12 = ((XmlElementDescriptor[])ArrayUtil.mergeArrays(super.getRootElementsDescriptors(paramXmlDocument), HtmlUtil.getCustomTagDescriptors(paramXmlDocument)));
/* 49:66 */     if (tmp15_12 == null) {
/* 50:66 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/html/RelaxedHtmlFromRngNSDescriptor", "getRootElementsDescriptors" }));
/* 51:   */     }
/* 52:66 */     return tmp15_12;
/* 53:   */   }
/* 54:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.html.RelaxedHtmlFromRngNSDescriptor

 * JD-Core Version:    0.7.0.1

 */